//
// CTileBorder.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CTileBorder {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CTileBorder(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTileBorder obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTileBorder(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CTileBorder() {
    this(nel3dJNI.new_CTileBorder(), true);
  }

  public void set(int width, int height, SWIGTYPE_p_std__vectorT_NLMISC__CBGRA_t array) {
    nel3dJNI.CTileBorder_set(swigCPtr, this, width, height, SWIGTYPE_p_std__vectorT_NLMISC__CBGRA_t.getCPtr(array));
  }

  public void get(SWIGTYPE_p_int width, SWIGTYPE_p_int height, SWIGTYPE_p_std__vectorT_NLMISC__CBGRA_t array) {
    nel3dJNI.CTileBorder_get(swigCPtr, this, SWIGTYPE_p_int.getCPtr(width), SWIGTYPE_p_int.getCPtr(height), SWIGTYPE_p_std__vectorT_NLMISC__CBGRA_t.getCPtr(array));
  }

  public void doubleSize() {
    nel3dJNI.CTileBorder_doubleSize(swigCPtr, this);
  }

  public boolean isEqual(CTileBorder border) {
    return nel3dJNI.CTileBorder_isEqual(swigCPtr, this, CTileBorder.getCPtr(border), border);
  }

  public void assign(CTileBorder border) {
    nel3dJNI.CTileBorder_assign(swigCPtr, this, CTileBorder.getCPtr(border), border);
  }

  public void serial(IStream f) {
    nel3dJNI.CTileBorder_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public boolean isSet() {
    return nel3dJNI.CTileBorder_isSet(swigCPtr, this);
  }

  public void reset() {
    nel3dJNI.CTileBorder_reset(swigCPtr, this);
  }

  public int getWidth() {
    return nel3dJNI.CTileBorder_getWidth(swigCPtr, this);
  }

  public int getHeight() {
    return nel3dJNI.CTileBorder_getHeight(swigCPtr, this);
  }

  public void rotate() {
    nel3dJNI.CTileBorder_rotate(swigCPtr, this);
  }

  public static boolean allAlphaSet(CTileBorder border, CTileBorder.TBorder where, SWIGTYPE_p_int pixel, SWIGTYPE_p_int composante) {
    return nel3dJNI.CTileBorder_allAlphaSet(CTileBorder.getCPtr(border), border, where.swigValue(), SWIGTYPE_p_int.getCPtr(pixel), SWIGTYPE_p_int.getCPtr(composante));
  }

  public static boolean compare(CTileBorder border1, CTileBorder border2, CTileBorder.TBorder where1, CTileBorder.TBorder where2, SWIGTYPE_p_int pixel, SWIGTYPE_p_int composante) {
    return nel3dJNI.CTileBorder_compare(CTileBorder.getCPtr(border1), border1, CTileBorder.getCPtr(border2), border2, where1.swigValue(), where2.swigValue(), SWIGTYPE_p_int.getCPtr(pixel), SWIGTYPE_p_int.getCPtr(composante));
  }

  public final static class TBorder {
    public final static TBorder top = new TBorder("top", nel3dJNI.CTileBorder_top_get());
    public final static TBorder bottom = new TBorder("bottom");
    public final static TBorder left = new TBorder("left");
    public final static TBorder right = new TBorder("right");
    public final static TBorder borderCount = new TBorder("borderCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TBorder swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TBorder.class + " with value " + swigValue);
    }

    private TBorder(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TBorder(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TBorder(String swigName, TBorder swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TBorder[] swigValues = { top, bottom, left, right, borderCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
